package com.wc.blue_bridge_test.base.T8;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 * @Author congege
 * @Description 数列特征
 * https://lx.lanqiao.cn/problem.page?gpid=T8
 * @Date Created in 2023/12/24-12:03
 */
public class Main {
    static FastReader in = new FastReader();

    public static void main(String[] args) {
        int n = in.nextInt();
        int min = (int) 1e4;
        int max = -(int) 1e4;
        int sum = 0;
        int num;
        while (n-- > 0) {
            num = in.nextInt();
            min = Math.min(min, num);
            max = Math.max(max, num);
            sum += num;
        }
        System.out.println(max);
        System.out.println(min);
        System.out.println(sum);
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
}
